import h from './dom/h'
import patch from './dom/patch'

// let vnode1 = h('div', {}, '你好呀')

let vnode1 = h('ul', {}, [
    h('li', { key: 'a' }, 'a'),
    h('li', { key: 'b' }, 'b'),
    h('li', { key: 'c' }, 'c')
])
let container = document.getElementById('container')
patch(container, vnode1)

let vnode2 = h('ul', {}, [
    h('li', { key: 'a' }, 'a'),
    h('li', { key: 'b' }, 'b'),
    h('li', { key: 'c' }, 'd')
])

let btn = document.getElementById('btn')
btn.onclick = (() => {
    console.log(vnode1);
    patch(vnode1, vnode2)
})
